<%--
  Created by IntelliJ IDEA.
  User: 28064
  Date: 2022/3/19
  Time: 10:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Deal Jsp</title>
</head>
<body>
<%
    String [][] Info={{"root","root"}};
    request.setCharacterEncoding("utf-8");
    boolean flag=false;
    String username=request.getParameter("username");
    String passwd=request.getParameter("password");
    for (int i=0;i< Info.length;i++){
        if(Info[i][0].equals(username))
            if (Info[i][1].equals(passwd)){
                flag=true;
                break;
        }
    }
    if (flag){
        session.setAttribute("username",username);
        response.sendRedirect("main.jsp");
    }else{
        response.sendRedirect("login.jsp");
    }
%>
</body>
</html>
